{extend name="$admin_layout" /}
{block name="style"}
<style>
	#table{
		width: 100% !important;
	}
	.form-control[disabled],
	.form-control[readonly],
	fieldset[disabled] .form-control {
		background-color: #FFFFFF;
		opacity: 1;
	}
</style>
<link rel="stylesheet" href="https://cdn.datatables.net/1.11.4/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/fixedcolumns/4.0.1/css/fixedColumns.dataTables.min.css">
{volist name="css_list" id="vo"}
<link rel="stylesheet" href="{$vo}?v={:config('asset_version')}">
{/volist}
{/block}
{block name="content"}
<script src="__PLUG__/layer/laydate/laydate.js?v={:config('asset_version')}"></script>
<div class="row">
    <div class="col-md-12">
        <div class="box nav-tabs-custom">
		    <ul class="nav nav-tabs">
				{volist name="tab_list" id="tab"}
				<li {if condition="$status === $tab['value']"}class="active"{/if}> <a href="{$tab.url}">{$tab.title}</a> </li>
				{/volist}
		    </ul>
		    <div class="box-body">
				<div class="tab-pane active">
					<div class="row">
						<form action="" method="get" class="marBtm">
								<div class="col-md-2 col-xs-6">
										<span class="txt">服务号：</span>
										<input type="text" class="form-control" name="server_no" placeholder="请输入服务号" value="{$Think.get.server_no}">
								</div>
                            <div class="col-md-2 col-xs-6">
                                <span class="txt">订单号：</span>
                                <input type="text" class="form-control" name="order_sn" placeholder="请输入订单号" value="{$Think.get.order_sn}">
                            </div>
								<div class="col-md-3 col-xs-6">
									<span class="txt">退货时间 ：</span>
									<input type="date" class="form-control js-date" readonly name="refund_time" placeholder="请输入日期" value="{$Think.get.refund_time}">
								</div>
								
							<div class="col-md-2 col-xs-6" style="padding-top: 18px;">
								<button class="btn btn-primary btn-flat" type="submit">搜索</button> <button class="btn btn-danger btn-flat" type="button" onclick="clearinput()">重置</button>
							</div>
						</form>
					</div>
				</div>
			</div>
            <div class="box-body">
                <div class="tab-pane active">

               <div class="table-responsive">
                    <table id="table" class="table table-builder table-hover table-bordered table-striped mb10">
                        <thead>
                        <th class="text-center">服务号</th>
                        <th class="text-center">退单商品</th>                      	
                        <th class="text-center">下单人</th> 
                        <th class="text-center">退款金额</th> 
                        <th class="text-center">支付类型</th>
						<th class="text-center">退货原因</th>
						<th class="text-center">退款方式</th>
                        <th class="text-center">退货状态</th>
                        <th class="text-center">申请时间</th>
                        <th class="text-center">操作</th>
                        </thead>
                        <tbody>
                        {volist name="list" id="o"}
                        <tr>
                            <td class="text-left"> 									
								{$o.server_no} 
                            </td>
                            <td class="text-left"> 							
								   <label  style="vertical-align:middle;font-weight:bold">	
									    <span class="label label-flat label-success">{$o.order_type_title}</span>								   
										订单号：
									    <a href="{:url('order/detail',['order_sn'=>$o['order_sn']])}">{$o.order_sn}</a>							
									</label>
									<table class="table table-striped table-bordered" style="vertical-align:top">								
										<tr>
											<td width="40px"><img src="{$o.goods_thumb|get_thumb}" width="40px" /></td>
											<td width="300px">
												<div>
												{$o.goods_name}																						
												</div>											
											    <div style="color:#999">{$o.sku_name}</div>		
												<div style="font-size:11px;color:#999">原价：<span class="text-danger">￥{$o.shop_price}</span></div>
												<div style="font-size:11px;color:#999">购买数量：x<span class="text-danger">{$o.goods_num}</span></div>
												<div style="font-size:11px;color:#999">退货数量：x<span class="text-danger">{$o.num}</span></div>										
											</td>										
										</tr>	
								   </table>		
								   <div style="font-size:11px;color:#999">订单总付款：<span class="text-danger">￥{$o.payable_money}</span></div>	
								   <div style="font-size:11px;color:#999">订单累计已退款：<span class="text-danger">￥{$o.total_refund_money}</span></div>									   
							</td>
                         
                            <td class="text-center">
							  <div><img src="{$o.head_img|get_thumb}" width="40px" /></div>
							  <div>{$o.user_nickname}</div>
							  <div>{$o.mobile}</div>
							</td>
                           <td class="text-center">
    						   ￥{$o.refund_money}
                            </td>                        
                          
                            <td class="text-center">
                                {if condition="$o['pay_status'] == 1"}                            
                                 	<span class="label label-flat label-success"> {$o.pay_type_title} </span>                                 
                                {/if}
                            </td>
							<td class="text-center"> {$o.refund_reason}</td>
							<td class="text-center"> {$o.refund_type_title}</td>
                            <td class="text-center"> 
                            {if condition="$o.status eq 0"}
                            		处理中
                            {elseif condition="$o.status neq 0"/} 
                                    已处理 【
											{if condition="$o.status eq 1"}
											<font color="#00FF00">同意退</font>
											{elseif condition="$o.status eq -1"/}
											<font color="#FF0000">驳回退</font>
											{elseif condition="$o.status eq -2"/}
											<font color="#FF0000">已撤销</font>
											{elseif condition="$o.status eq 2"/}
											<font color="#0000FF">待打款</font>
											{elseif condition="$o.status eq 3"/}
											<font color="#666666">已打款</font>
											{/if}
											】
							 {elseif condition="$o.status neq -2"/} 
							         已取消
                            {/if}
                            </td>
                            <td class="text-center">{$o.create_time|date="Y-m-d H:i:s"}</td>
                            <td class="text-center">
                                <a  title="查看详情" href="{:url('refund_detail',['rfid'=>$o.id])}" class="btn btn-xs mr5 btn-default btn-flat">查看详情</a>
								{if condition="$o.status eq 0"}
									{eq name="$o.refund_type" value="1"}
                                   <a  title="退货通过且打款" href="{:url('refund_sure',['rfid'=>$o.id])}" class="btn btn-xs mr5 btn-success btn-flat confirm ajax-get"><i class="fa fa-check-circle pr5"></i>退货通过</a>
									{else /}
									 <a  title="退货通过" href="{:url('refund_sure',['rfid'=>$o.id,'layer'=>1,'reload'=>1])}" class="btn btn-xs mr5 btn-success btn-flat" data-toggle="dialog-right"><i class="fa fa-check-circle pr5"></i>退货通过</a>
									{/eq}
								   
								   <a  title="退货驳回" href="{:url('refund_del',['rfid'=>$o.id,'layer'=>1,'reload'=>1])}" class="btn btn-xs mr5 btn-danger btn-flat" data-toggle="dialog-right"><i class="fa fa-ban pr5"></i>退货驳回</a>
			                    {else/}
			                   	   {if condition="$o.status eq 1"}
								   <a  title="确认收货" href="{:url('refund_express',['rfid'=>$o.id,'layer'=>1,'reload'=>1])}" class="btn btn-xs mr5 btn-info btn-flat" data-toggle="dialog-right"><i class="fa fa-check-circle pr5"></i>确认收货</a>
								   {elseif condition="$o.status eq 2" /}
								   <a  title="打款账户" href="{:url('refund_change_status',['val'=>3,'rfid'=>$o.id])}" class="btn btn-xs mr5 btn-danger btn-flat confirm ajax-get"><i class="fa fa-check-circle pr5"></i>打款账户</a>
								   {/if}
								{/if}
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                    </div>
                    <div class="data-table-toolbar">
                        <div class="row">
                            {$pages|raw}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="https://cdn.datatables.net/1.11.4/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/fixedcolumns/4.0.1/js/dataTables.fixedColumns.min.js"></script>
{volist name="js_list" id="vo"}
<script src="{$vo}?v={:config('asset_version')}"></script>
{/volist}
<script>
	$(document).ready(function() {
		$('#table').DataTable({
			scrollY: '1000px',
			scrollX: '100%',
			scrollCollapse: true,
			paging: false,
			info: false,
			searching:false,
			ordering:false,
			fixedColumns: {
				right: 1,
			}
		});
	})
</script>
{/block}
